import random

teacher = ['t1', 't2', 't3', 't4', 't5', 't6', 't7', 't8']
room = [[], [], []]

for i in teacher:
    a = random.randint(0, len(room)-1)
    room[a].append(i)
for i in range(len(room)):
    print(f'办公室{i+1},人数是:{len(room[i])},分别是:')
    for name in room[i]:
        print(name,end='\t')
    print()

